export default Object.assign({}, {
  getOptions: function (options) { 
    const { chartData } = options
    const xAxis = {
      type: 'category',
      data: chartData?.labels
    }
    const yAxis = {
      type: 'value',
      axisLabel: {
        formatter: '{value} ppt'
      }
    }
    const grid = {
      left: '2%',
      top: '6%',
      bottom: '2%'
    }
    const tooltip = {
      show: true,
      trigger: 'axis',
      valueFormatter: (value) => value + 'ppt'
    }
    const series = [
      {
        data: chartData?.series,
        type: 'line',
        label: {
          show:true,
          formatter: '{c} ppt'
        },
        smooth: false 
      }
    ]
    return { xAxis, yAxis, series,tooltip, grid }
  },
  render: function (instance, options) {
    instance && instance.setOption(options, true)
    return instance
  },
})